package com.ruoyi.gams.service.impl;

import java.util.List;

import com.ruoyi.gams.vo.GamsDeviceBussinessRelationAddParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.gams.mapper.GamsDeviceBussinessRelationMapper;
import com.ruoyi.gams.domain.GamsDeviceBussinessRelation;
import com.ruoyi.gams.service.IGamsDeviceBussinessRelationService;

/**
 * 设备业务关系Service业务层处理
 *
 * @author ruoyi
 */
@Service
public class GamsDeviceBussinessRelationServiceImpl implements IGamsDeviceBussinessRelationService
{
    @Autowired
    private GamsDeviceBussinessRelationMapper gamsDeviceBussinessRelationMapper;

    /**
     * 查询设备业务关系
     *
     * @param id 设备业务关系主键
     * @return 设备业务关系
     */
    @Override
    public GamsDeviceBussinessRelation selectGamsDeviceBussinessRelationById(Integer id)
    {
        return gamsDeviceBussinessRelationMapper.selectGamsDeviceBussinessRelationById(id);
    }

    /**
     * 查询设备业务关系列表
     *
     * @param gamsDeviceBussinessRelation 设备业务关系
     * @return 设备业务关系
     */
    @Override
    public List<GamsDeviceBussinessRelation> selectGamsDeviceBussinessRelationList(GamsDeviceBussinessRelation gamsDeviceBussinessRelation)
    {
        return gamsDeviceBussinessRelationMapper.selectGamsDeviceBussinessRelationList(gamsDeviceBussinessRelation);
    }

    /**
     * 新增设备业务关系
     *
     * @param gamsDeviceBussinessRelation 设备业务关系
     * @return 结果
     */
    @Override
    public int insertGamsDeviceBussinessRelation(GamsDeviceBussinessRelation gamsDeviceBussinessRelation)
    {
        return gamsDeviceBussinessRelationMapper.insertGamsDeviceBussinessRelation(gamsDeviceBussinessRelation);
    }

    /**
     * 修改设备业务关系
     *
     * @param gamsDeviceBussinessRelation 设备业务关系
     * @return 结果
     */
    @Override
    public int updateGamsDeviceBussinessRelation(GamsDeviceBussinessRelation gamsDeviceBussinessRelation)
    {
        return gamsDeviceBussinessRelationMapper.updateGamsDeviceBussinessRelation(gamsDeviceBussinessRelation);
    }

    /**
     * 批量删除设备业务关系
     *
     * @param ids 需要删除的设备业务关系主键
     * @return 结果
     */
    @Override
    public int deleteGamsDeviceBussinessRelationByIds(Integer[] ids)
    {
        return gamsDeviceBussinessRelationMapper.deleteGamsDeviceBussinessRelationByIds(ids);
    }

    /**
     * 删除设备业务关系信息
     *
     * @param id 设备业务关系主键
     * @return 结果
     */
    @Override
    public int deleteGamsDeviceBussinessRelationById(Integer id)
    {
        return gamsDeviceBussinessRelationMapper.deleteGamsDeviceBussinessRelationById(id);
    }

    /**
     * 批量插入
     *
     * @param param@return
     */
    @Override
    public int insertBatch(GamsDeviceBussinessRelationAddParam param)
    {
        return gamsDeviceBussinessRelationMapper.insertBatch(param);
    }

    @Override
    public int deleteByDeviceId(Integer deviceId)
    {
        return gamsDeviceBussinessRelationMapper.deleteByDeviceId(deviceId);
    }

    @Override
    public List<Integer> findBussinessIdByDeviceId(Integer deviceId, Integer type)
    {
        return gamsDeviceBussinessRelationMapper.findBussinessIdByDeviceId(deviceId, type);
    }
}
